package Class2;

public class EnumExample {
    public static void main(String[] args) {
        Mango p1 = Mango.Carrie;
        Mango p2 = Mango.Haden;
        Mango p3 = Mango.Fairchild;

        System.out.println("Mangos are ...");
        System.out.println(p1);
        System.out.println(p2);
        System.out.println(p3);
        System.out.println("Using for-each loop");

        for(Mango p:Mango.values()){
            System.out.println(p);
        }

        System.out.println("Price Details");
        System.out.println("Carrie: "+p1.getPrice());
        System.out.println("Haden: "+p2.getPrice());
        System.out.println("Fairchild: "+p3.getPrice());

        System.out.println("Using for-each loop");
        for(Mango M:Mango.values()){
            System.out.println(M+"::"+M.getPrice());
        }
    }
}
